package pc30;

import java.util.Scanner;

public class J10SungJuk {
	public static void main(String[]args){
		//변수선언
		String name;
		int kor,eng,mat,Tot;
		double Avg;
		Scanner sc;
		
		//2 데이터 및 성적처리
		//키보드 입력을 위한 scanner 초기화
		sc  = new Scanner(System.in);
		System.out.println("이름을 입력하세요");
		name = sc.next(); 
		System.out.println("국어을 입력하세요");
		kor = sc.nextInt(); 
		System.out.println("영어을 입력하세요");
		eng = sc.nextInt(); 
		System.out.println("수학을 입력하세요");
		mat = sc.nextInt(); 
	
		//계산식
		Tot=getTot(kor,eng,mat);
		Avg=getAvg((double)Tot);
		
		System.out.println(Tot);
		System.out.println(Avg);
		
	}//main
	private static double getAvg(double Tot) {
		double Avg;
		Avg=Tot/3;
		return Avg;	
	}
	private static int getTot(int kor, int eng, int mat) {
		int Tot;
		Tot=kor + eng + mat;
		return Tot;
	}

}
